<div class="contents">
 <ol class="breadcrumb" ng-if="id ? 'false':'true'">
    <li><a href="#/index/panel">首页</a></li>
    <li><a href="#/simu/list">私募基金</a></li>
    <li class="active">{{ id ? "编辑私募基金" : "新增私募基金"}}</li>
  </ol>
  <form class="form-horizontal" role="form" name="form" ng-submit="save()" novalidate>  
    <span ng-if="item.outProductId">外场</span>
    <input type="hidden" ng-model="item.outProductId">
    <div class="form-group" ng-class="{'has-error':form.jjqc.$invalid}">
      <label class="col-sm-2 control-label">基金全称*</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="基金全称" name="jjqc" ng-model="item.jjqc" required="required">
      </div>
    </div>    
  
    <div class="form-group" ng-class="{'has-error':form.jjmc.$invalid}">
      <label class="col-sm-2 control-label">基金简称</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="基金简称" name="jjmc" ng-model="item.jjmc" >
      </div>
    </div>
  
    <div class="form-group" ng-class="{'has-error':form.jjbm.$invalid}" ng-show="!id">
      <label class="col-sm-2 control-label">基金编码</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" readonly="true" placeholder="基金编码" name="jjbm" ng-model="item.jjbm" required="required">
      </div>
      <a  class="brand" ng-click="getJJBM()" href="">刷新基金编码</a>
    </div>

    <div class="form-group" ng-class="{'has-error':form.jjfl.$invalid}">
      <label class="col-sm-2 control-label">基金分类*</label>
      <div class="col-sm-5">
        <select class="form-control" placeholder="基金分类" ng-model="item.jjfl" name="jjfl" ng-options="m.value as m.text for m in dictMap.jjflModelNew" required="required"></select> 
      </div>
    </div>
  
    <div class="form-group" ng-class="{'has-error':form.jgxs.$invalid}">
      <label class="col-sm-2 control-label">结构形式*</label>
      <div class="col-sm-5">
        <select class="form-control" placeholder="结构形式" ng-model="item.jgxs" name="jgxs" ng-options="m.value as m.text for m in dictMap.jgxsModel" required="required"></select>
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.zzxs.$invalid}">
      <label class="col-sm-2 control-label">组织形式*</label>
      <div class="col-sm-5">
        <select class="form-control" placeholder="组织形式" ng-model="item.zzxs" name="zzxs" ng-options="m.value as m.text for m in dictMap.zzxsModel" required="required"></select>
      </div>
    </div> 

    <div class="form-group" ng-class="{'has-error':form.tgyh.$invalid}">
      <label class="col-sm-2 control-label">托管方*</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="托管方" name="tgyh" ng-model="item.tgyh" required="required">
      </div>
    </div>   

    <div class="form-group" ng-class="{'has-error':form.jjfxr.$invalid}">
      <label class="col-sm-2 control-label">基金发行方*</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="基金发行方" name="jjfxr" ng-model="item.jjfxr" required="required">
      </div>
    </div>
    <div class="form-group" ng-class="{'has-error':form.zdrgje.$invalid}">
      <label class="col-sm-2 control-label">最低认购金额*</label>
      <div class="col-sm-5">
        <input type="number" class="form-control" placeholder="最低认购金额" name="zdrgje" ng-model="item.zdrgje" min="0" required="required">
        <span class="form-control-feedback">万元</span>
      </div>
    </div>
  
    <div class="form-group" ng-class="{'has-error':form.zjzdje.$invalid}">
      <label class="col-sm-2 control-label">最低追加金额*</label>
      <div class="col-sm-5">
        <input type="number" class="form-control" placeholder="最低追加金额" name="zjzdje" ng-model="item.zjzdje" min="0" required="required">
        <span class="form-control-feedback">万元</span>
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.pIssuerScore.$invalid}">
      <label class="col-sm-2 control-label">发行机构得分</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="发行机构得分" name="pIssuerScore" ng-model="item.pIssuerScore" >
      </div>
    </div>
    <div class="form-group" ng-class="{'has-error':form.pLiquidityScore.$invalid}">
      <label class="col-sm-2 control-label">产品流动性得分</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="产品流动性得分" name="pLiquidityScore" ng-model="item.pLiquidityScore" >
      </div>
    </div>
    <div class="form-group" ng-class="{'has-error':form.pRevenueScore.$invalid}">
      <label class="col-sm-2 control-label">产品收益得分</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="产品收益得分" name="pRevenueScore" ng-model="item.pRevenueScore" >
      </div>
    </div>
    <div class="form-group" ng-class="{'has-error':form.pFinancierScore.$invalid}">
      <label class="col-sm-2 control-label">融资方得分</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="融资方得分" name="pFinancierScore" ng-model="item.pFinancierScore" >
      </div>
    </div>
    <div class="form-group" ng-class="{'has-error':form.pFinancierDebtScore.$invalid}">
      <label class="col-sm-2 control-label">融资项目评级得分</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="融资项目评级得分" name="pFinancierDebtScore" ng-model="item.pFinancierDebtScore" >
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.tjzl.$invalid}">
      <label class="col-sm-2 control-label">
        提交资料<span class="required">*</span>
      </label>
      <div class="col-sm-5">
        <label ng-repeat="tjzlitem in dictMap.tjzlModel">
            <input type="checkbox" name="tjzl" ng-model="allTjzls[tjzlitem.value]" value="{{tjzlitem.value}}">
            {{tjzlitem.text}}
        </label>
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.jjgs.$invalid}">
      <label class="col-sm-2 control-label">基金公司*</label>
      <div class="col-sm-5 simu-company-box row">
        <div class="col-sm-6">
          <div class="simu-company-search"><input type="text" ng-model="companyKw" placeholder="输入名称搜索基金公司"/></div>
          <ul class="simu-c-selecting">
            <li ng-repeat="c in simuCompanyListing" ng-click="selectCompany(c.id,$index,1)" title="{{c.gsmc}}">{{c.gsmc | truncate:14}}</li>
          </ul>
        </div>
        <div class="col-sm-6">
          <div class="simu-company-search">已选择：</div>
          <ul class="simu-c-selected">
            <li ng-repeat="c in simuCurCompanyListed" ng-click="unSelectCompany(c.id,$index,1)" title="{{c.gsmc}}">{{c.gsmc | truncate:14}}</li>
          </ul>
        </div>
      </div>
    </div>    
  
    <div class="form-group" ng-class="{'has-error':form.jjgs.$invalid}">
      <label class="col-sm-2 control-label">基金经理1*</label>
      <div class="col-sm-5 simu-company-box row">
        <div class="col-sm-6">
          <div class="simu-company-search"><input type="text" ng-model="managerKw" placeholder="输入名称搜索基金经理"/></div>
          <ul class="simu-c-selecting">
            <li ng-repeat="c in simuManagerListing" ng-click="selectManager(c.id,$index,1)">{{c.jjjlmc}}</li>
          </ul>
        </div>
        <div class="col-sm-6">
          <div class="simu-company-search">已选择：</div>
          <ul class="simu-c-selected">
            <li ng-repeat="c in simuManagerListed1" ng-click="unSelectManager(c.id,$index,1)">{{c.jjjlmc}}</li>
          </ul>
        </div>
      </div>
    </div>  
  
    <div class="form-group" ng-class="{'has-error':form.jjgs.$invalid}">
      <label class="col-sm-2 control-label">基金经理2</label>
      <div class="col-sm-5 simu-company-box row">
        <div class="col-sm-6">
          <div class="simu-company-search"><input type="text" ng-model="managerKw" placeholder="输入名称搜索基金经理"/></div>
          <ul class="simu-c-selecting">
            <li ng-repeat="c in simuManagerListing" ng-click="selectManager(c.id,$index,0)">{{c.jjjlmc}}</li>
          </ul>
        </div>
        <div class="col-sm-6">
          <div class="simu-company-search">已选择：</div>
          <ul class="simu-c-selected">
            <li ng-repeat="c in simuManagerListed2" ng-click="unSelectManager(c.id,$index,0)">{{c.jjjlmc}}</li>
          </ul>
        </div>
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.jjclsj.$invalid}">
      <label class="col-sm-2 control-label">基金成立日期</label>
      <div class="col-sm-5">
        <!--
        <input type="text" class="form-control" placeholder="基金成立日期，格式如2015-01-01" name="jjclsj" ng-model="item.jjclsjstr" ng-pattern="/^\d{4}-\d{2}-\d{2}$/">
        -->
         <input type="date" class="form-control" placeholder="基金成立日期，格式如2015-01-01" name="jjclsjstr" ng-model="item.jjclsjstr" maxlength="10" max="9999-99-99" ng-pattern="/^\d{4}-\d{2}-\d{2}$/">
      </div>
    </div>    
    <div class="form-group" ng-class="{'has-error':form.kfrq.$invalid}">
      <label class="col-sm-2 control-label">开放日期</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="开放日期" name="kfrq" ng-model="item.kfrq"  >
      </div>
    </div>    
    <div class="form-group" ng-class="{'has-error':form.fbq.$invalid}">
      <label class="col-sm-2 control-label">封闭期</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="封闭期" name="fbq" ng-model="item.fbq" >
      </div>
    </div>
    <div class="form-group" ng-class="{'has-error':form.gzr.$invalid}">
      <label class="col-sm-2 control-label">估值日</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="估值日" name="gzr" ng-model="item.gzr" >
      </div>
    </div>    
  
    <div class="form-group" ng-class="{'has-error':form.jjzt.$invalid}">
      <label class="col-sm-2 control-label">基金状态</label>
      <div class="col-sm-5">
        <!--
        <input type="text" class="form-control" placeholder="基金状态" name="jjzt" ng-model="item.jjzt" >
        -->
        <select class="form-control" placeholder="基金状态" ng-model="item.jjzt" name="jjzt" ng-options="m.value as m.text for m in dictMap.jjztModel" ></select>
      </div>
    </div>
    
    <div class="form-group" ng-class="{'has-error':form.bah.$invalid}">
      <label class="col-sm-2 control-label">备案号</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="备案号" name="bah" ng-model="item.bah" >
      </div>
    </div>   

    <div class="form-group" ng-class="{'has-error':form.bz.$invalid}">
      <label class="col-sm-2 control-label">币种</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="币种" name="bz" ng-model="item.bz" >
      </div>
    </div>    
  
    <div class="form-group" ng-class="{'has-error':form.jzdw.$invalid}">
      <label class="col-sm-2 control-label">净值单位</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="净值单位" name="jzdw" ng-model="item.jzdw" >
      </div>
    </div>    
  
    <div class="form-group" ng-class="{'has-error':form.cpqxsm.$invalid}">
      <label class="col-sm-2 control-label">产品期限说明</label>
      <div class="col-sm-5">
       <textarea class="form-control" placeholder="产品期限说明" name="cpqxsm" ng-model="item.cpqxsm" style="height:100px;">
         
       </textarea>
       <!-- <input type="text" class="form-control" placeholder="产品期限说明" name="cpqxsm" ng-model="item.cpqxsm" >  -->
      </div>
    </div>    

     <div class="form-group" ng-class="{'has-error':form.productAdvantage.$invalid}">
      <label class="col-sm-2 control-label">
        产品优势
      </label>
      <div class="col-sm-7">
        <div class="ueditor" config="config" ready="ready" ng-model="item.productAdvantage" style="height:300px;" ></div>
      </div>
    </div> 
     <div class="form-group" ng-class="{'has-error':form.riskControl.$invalid}">
      <label class="col-sm-2 control-label">
        风险控制
      </label>
      <div class="col-sm-7">
        <div class="ueditor" config="config" ready="ready" ng-model="item.riskControl" style="height:300px;" ></div>
      </div>
    </div>
  
    <div class="form-group">
      <div class="col-sm-offset-2 col-sm-5">
        <button type="submit" class="btn btn-default"  has-auth where="btn" who="PRODUCT_EDIT" owner="{{item.createBy}}">提交</button>
      </div>
    </div>
  </form>
</div>
